package cn.iocoder.yudao.module.crossborder.platform.dal.mysql.platformcategorymapping;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crossborder.platform.dal.dataobject.platformcategorymapping.PlatformCategoryMappingDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformcategorymapping.vo.*;

/**
 * 跨境电商平台分类映射 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PlatformCategoryMappingMapper extends BaseMapperX<PlatformCategoryMappingDO> {

    default PageResult<PlatformCategoryMappingDO> selectPage(PlatformCategoryMappingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PlatformCategoryMappingDO>()
                .eqIfPresent(PlatformCategoryMappingDO::getPlatformId, reqVO.getPlatformId())
                .eqIfPresent(PlatformCategoryMappingDO::getLocalCategoryId, reqVO.getLocalCategoryId())
                .likeIfPresent(PlatformCategoryMappingDO::getLocalCategoryName, reqVO.getLocalCategoryName())
                .eqIfPresent(PlatformCategoryMappingDO::getPlatformCategoryId, reqVO.getPlatformCategoryId())
                .likeIfPresent(PlatformCategoryMappingDO::getPlatformCategoryName, reqVO.getPlatformCategoryName())
                .eqIfPresent(PlatformCategoryMappingDO::getPlatformCategoryPath, reqVO.getPlatformCategoryPath())
                .eqIfPresent(PlatformCategoryMappingDO::getMappingLevel, reqVO.getMappingLevel())
                .eqIfPresent(PlatformCategoryMappingDO::getMappingConfidence, reqVO.getMappingConfidence())
                .eqIfPresent(PlatformCategoryMappingDO::getIsAutoMapped, reqVO.getIsAutoMapped())
                .eqIfPresent(PlatformCategoryMappingDO::getMappingRule, reqVO.getMappingRule())
                .eqIfPresent(PlatformCategoryMappingDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PlatformCategoryMappingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PlatformCategoryMappingDO::getId));
    }

}